<template>
  <div id="app">
    <transition :name="transitionName">
      <router-view class="route-view"></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'app',
  computed: {
    transitionName () {
      return this.$store.getters.transitionName || 'slide-right'
    }
  }
}
</script>

<style lang="scss">
@import './styles/index.scss';
#app {
  width: 100%;
  height: 100%;
  position: absolute;
  overflow: hidden;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  // 路由过渡动画 - 用于整个页面的过度
  .slide-left-enter, .slide-right-leave-active {
    opacity: 0;
    transform: translate(30px, 0);
  }
  .slide-left-leave-active, .slide-right-enter {
    opacity: 0;
    transform: translate(-30px, 0);
  }
  .route-view {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all .3s cubic-bezier(.55,0,.1,1);
  }
}
</style>
